﻿<UserControl x:Class="CTX.CtxPackage.MyControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Name="MyToolWindow">
    <Grid>
        <StackPanel Orientation="Vertical">
            <GroupBox Padding="3">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*"></ColumnDefinition>
                        <ColumnDefinition Width="0.5*"></ColumnDefinition>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0">                        
                    </StackPanel>
                    <StackPanel Grid.Column="2">
                        <Button Content="Build Solution" Command="{Binding BuildSolutionCommand}"></Button>
                        <Button Content="Rebuild Solution" Command="{Binding RebuildSolutionCommand}"></Button>
                        <Button Content="Clear Solution" Command="{Binding ClearSolutionCommand}"></Button>
                    </StackPanel>
                </Grid>
            </GroupBox>
            
            <DataGrid Name="DataGrid1" ItemsSource="{Binding Projects}" AutoGenerateColumns="False">
                <DataGrid.Columns>                    
                    <DataGridTextColumn Binding="{Binding Name, Mode=OneWay}" Header="Name" />
                    <DataGridTextColumn Binding="{Binding FullName, Mode=OneWay}" Header="FullName"  Width="300"/>
                    <DataGridTextColumn Binding="{Binding OutputType, Mode=OneWay}" Header="Output Type" />
                    <DataGridTextColumn Binding="{Binding Kind, Mode=OneWay}" Header="Kind" Visibility="Hidden"/>
                    <DataGridTemplateColumn Header="Build" Width="100">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="Build" Command="{Binding BuildCommand}" CommandParameter="{Binding Project}"></Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Publish" Width="100">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="Publish" Command="{Binding PublishCommand}" CommandParameter="{Binding Project}"></Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Configure Publish" Width="200">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="Configure Publish" Command="{Binding ConfigurePublishCommand}" CommandParameter="{Binding Project}"></Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Properties" Width="200">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="Properties" Command="{Binding PropertiesCommand}" CommandParameter="{Binding Project}"></Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </Grid>
</UserControl>
